<template>
  <div class="good-list">
    <goods-list-item :goodslistitems="goodslistitems"/>
  </div>
</template>

<script>
  import {getdata} from "../../../network/request";
  import goodsListItem from "./goodsListItem";

  export default {
    name: "goodsList",
    components:{
      goodsListItem
    },
    data(){
      return{
        goodslistitems:[],
      }
    },
    props:{
      ouccerrindex:{
        type:Number,
        default:0
      }
    },
    created() {
      getdata().then(
          res=>{
            //商品信息
            // this.goodslist=res.data.goods;
            this.goodslistitems=res.data.goods[this.ouccerrindex].foods;
            //console.log(this.goodslistitems);
          }
      )
    },
    updated() {
      getdata().then(
          res=>{
            //商品信息
            // this.goodslist=res.data.goods;
            this.goodslistitems=res.data.goods[this.ouccerrindex].foods;
            //console.log(this.goodslistitems);
          }
      )
    }

  }
</script>

<style scoped>
  .good-list{
    width: 100%;

  }


</style>